package com.ibeetl.cms.service;

import java.util.List;

import com.ibeetl.cms.entity.HighlevelTalents;
import com.ibeetl.cms.entity.Renting;
import com.ibeetl.cms.web.query.KeyInformationQuery;
import org.beetl.sql.core.engine.PageQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.ibeetl.admin.core.util.PlatformException;

import com.ibeetl.cms.dao.KeyInformationDao;
import com.ibeetl.cms.entity.KeyInformation;
import com.ibeetl.admin.core.service.BaseService;

/**
 * KeyInformation Service
 */

@Service
@Transactional
public class KeyInformationService extends BaseService<KeyInformation>{

    @Autowired
    private KeyInformationDao keyInformationDao;

    public PageQuery<KeyInformation>queryByCondition(PageQuery query){
        PageQuery ret =  keyInformationDao.queryByCondition(query);
        queryListAfter(ret.getList());
        return ret;
    }

    public void batchDelKeyInformation(List<Long> ids){
        try {
            keyInformationDao.batchDelKeyInformationByIds(ids);
        } catch (Exception e) {
            throw new PlatformException("批量删除KeyInformation失败", e);
        }
    }

    public PageQuery<KeyInformation> queryEmployees(PageQuery page) {
        page.setPageSize(Integer.MAX_VALUE);

        PageQuery ret =  keyInformationDao.queryEmployees(page);
        queryListAfter(ret.getList());
        return ret;
    }

    //查企业
    public PageQuery<KeyInformation>findenterprise(PageQuery query){
        PageQuery ret =  keyInformationDao.findenterprise(query);
        queryListAfter(ret.getList());
        return ret;
    }

    public List<KeyInformation>queryCompany(KeyInformationQuery condtion){
        List<KeyInformation> ret =  keyInformationDao.queryCompany(condtion);
        queryListAfter(ret);
        return ret;
    }
    public PageQuery<KeyInformation> queryDoneTask(PageQuery page) {
        PageQuery ret =  keyInformationDao.queryDoneTask(page);
        queryListAfter(ret.getList());
        return ret;

    }
}